package com.ffyc.backserver.config;

import com.ffyc.backserver.common.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer{

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		InterceptorRegistration inter =  registry.addInterceptor(new LoginInterceptor());
				inter.addPathPatterns("/**");//拦截地址
				inter.excludePathPatterns("/api/login/login");//放行地址

				//inter.excludePathPatterns("/swagger*/**");
				//inter.excludePathPatterns("/v2/**");
				//inter.excludePathPatterns("/webjars/**");

	}
}
